package com.mo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.remoting.caucho.HessianServiceExporter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.mo.config.properties.HessianProperties;
import com.mo.config.properties.JwtProperties;
import com.mo.tv.service.IZlUserService;

/**
 * mo Web程序启动类
 *
 * @author chenxiaodong
 * @date 2018-05-21 9:43
 */
public class HessianServletInitializer extends WebMvcConfigurerAdapter {

	@Autowired
	private JwtProperties jwtProperties;
	@Autowired
	private HessianProperties hessianProperties;



	/*@Bean
	public MoHessianProxyFactoryBean muserService() {
		MoHessianProxyFactoryBean factory = new MoHessianProxyFactoryBean(
				jwtProperties.getMd5Key(), jwtProperties.getSecret(),
				jwtProperties.getExpiration());
		factory.setServiceUrl(hessianProperties.getMobileHessianUrl()
				+ "/hessian/muserService");
		factory.setServiceInterface(IMuserService.class);
		return factory;
	}*/


	@Autowired
	private IZlUserService zlUserService;

	@Bean(name = "/hessian/zlUserService")
	public HessianServiceExporter zlUserService() {
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(zlUserService);
		exporter.setServiceInterface(IZlUserService.class);
		return exporter;
	}


}
